package conf

import (
	"github.com/spf13/viper"
	"go.uber.org/zap"
)

// GCPSection map toml [gcp]
type GCPSection struct {
	EndPoint string `mapstructure:"end_point"`
	APIKey   string `mapstructure:"api_key"`
}

// ReadGCP get pg section from config
func ReadGCP(v *viper.Viper, slog *zap.SugaredLogger) (gcpConfPtr *GCPSection) {
	gcpConfPtr = &GCPSection{}
	err := v.Unmarshal(gcpConfPtr)
	if err != nil {
		slog.Panicf("unable to decode into gcp section, %v", err)
	}
	return
}

type GCPProxy interface {
	GetEndPoint() string
	GetAPIKey() string
}

